package com.suyun.service;

import com.suyun.domain.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

// 指明服务名 nacos中的服务名
@FeignClient(value = "service-producter")
public interface ProductService {
    // Product product = restTemplate.getForObject("http://service-producter/product/" + pid, Product.class);
    // value+RequestMapping 就等于请求地址
    @RequestMapping("/product/{pid}") //指定访问地址
    Product findByPid(@PathVariable Integer pid);
}
